package com.alipay.config;

import java.io.InputStream;
import java.util.PropertyResourceBundle;

import org.apache.log4j.Logger;

import com.unionpay.upmp.sdk.conf.UpmpConfig;



/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *版本：3.3
 *日期：2012-08-10
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
	
 *提示：如何获取安全校验码和合作身份者ID
 *1.用您的签约支付宝账号登录支付宝网站(www.alipay.com)
 *2.点击“商家服务”(https://b.alipay.com/order/myOrder.htm)
 *3.点击“查询合作者身份(PID)”、“查询安全校验码(Key)”

 *安全校验码查看时，输入支付密码后，页面呈灰色的现象，怎么办？
 *解决方法：
 *1、检查浏览器配置，不让浏览器做弹框屏蔽设置
 *2、更换浏览器或电脑，重新登录查询。
 */

public class AlipayConfig {
	
	private static Logger logger = Logger.getLogger(AlipayConfig.class);
	//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
	// 合作身份者ID，以2088开头由16位纯数字组成的字符串
	public static String recharge_partner  ;
	public static String card_partner ;
	
	// 商户的私钥
	
	public static String recharge_key  ;
	public static String card_key ;
	public static String public_key = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDkj/41LQbnoMdwjypltZbxcBMsKPjGDduwcc5yKaGuSuk3QCGLft5Ex2gUJnkTXPF20+7beIb9g83Niiu9GljtUb5Wrt12vk5tV76bUa9XC/jPMHbQolw+0h1fv6AyXydDTb58TUl/8FPRXCO4FWdylgc70caMI3jnsgP53D7EjwIDAQAB";

	//商户前台通知地址
	public static String recharge_front_url;
	public static String card_front_url;
	
	public static String recharge_wap_front_url;
	public static String card_wap_front_url;
	//商户后台通知地址
	public static String recharge_notify_url;
	public static String card_notify_url;
	public static String recharge_wap_notify_url ;
	public static String card_wap_notify_url ;
	public static String wap_return_url  ;
	//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
	
	//支付宝账号
	public static String card_account ;
	public static String recharge_account;

	public static String card_pay_time_out ;
	public static String recharge_pay_time_out;
	
	// 调试用，创建TXT日志文件夹路径
	public static String log_path = "D:\\";

	// 字符编码格式 目前支持 gbk 或 utf-8
	public static String input_charset = "utf-8";
	
	// 签名方式 不需修改
	public static String sign_type = "MD5";
	//支付宝wap支付网关
	public static String ALIPAY_GATEWAY_NEW = "http://wappaygw.alipay.com/service/rest.htm?";
	public static String payGateWay="https://www.alipay.com/cooperate/gateway.do?"; //支付接口(不可修改)
	//支付宝单笔查询接口服务(不可修改)
	public static String singleTradeService = "single_trade_query";// 
	
	static {
		try{																												 
			InputStream fis = AlipayConfig.class.getClassLoader().getResourceAsStream("alipay.properties");
			PropertyResourceBundle props = new PropertyResourceBundle(fis);
			recharge_partner = props.getString("ali_recharge_pid");
			card_partner = props.getString("ali_card_pid");
			recharge_key = props.getString("ali_recharge_key");
			card_key = props.getString("ali_card_key");
			recharge_front_url=props.getString("ali_recharge_return_url");
			card_front_url = props.getString("ali_card_return_url");
			recharge_notify_url= props.getString("ali_recharge_notify_url");
			card_notify_url= props.getString("ali_card_notify_url");
			card_account = props.getString("ali_card_sid");
			recharge_account=props.getString("ali_recharge_sid");
			card_pay_time_out = props.getString("card_pay_time_out") ;
			recharge_pay_time_out =props.getString("recharge_pay_time_out");
			
			recharge_wap_front_url = props.getString("ali_recharge_wap_return_url");
			card_wap_front_url = props.getString("ali_card_wap_return_url") ;
			recharge_wap_notify_url = props.getString("ali_recharge_wap_notify_url");
			card_wap_notify_url=props.getString("ali_card_wap_notify_url");
			wap_return_url =props.getString("ali_wap_return_url");
			
			
		}catch(Exception e){
			logger.error(e.getMessage(), e);
		}
		
	}
	
	public static void main(String[] args){
		System.out.println(recharge_wap_front_url);
		System.out.println(card_wap_front_url);
		System.out.println(recharge_wap_notify_url);
		System.out.println(card_wap_notify_url);
	}
}
